package edu.upol.paradise.compiler.types;

import java.lang.reflect.Type;

import org.apache.log4j.Logger;

import com.google.gson.InstanceCreator;

public class Nil implements ParadisePair {
	static final Logger log = Logger.getLogger(Nil.class);
	public static final Nil NIL = new Nil();

	public static class NilInstanceCreator implements InstanceCreator<Nil>{

		public Nil createInstance(Type type) {
			return Nil.NIL;
		}
		
	}
	
	private Nil(){
		
	}
	
	public ParadiseObject car() {
		return Nil.NIL;
	}
	public ParadiseObject cdr() {
		return Nil.NIL;
	}
	public boolean isTrue() {
		return false;
	}
	public boolean isList() {
		return true;
	}
	
	public String toString(){
		return "NIL";
	}

	public boolean isAtom() {
		return false;
	}

	public boolean valueEquals(ParadiseObject other) {
		if (other == this) return true;
		return false;
	}
	
	public int atomHashId() {
		return -1;
	}
}